// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: console.hpp 219 2008-09-04 14:50:25Z heavyzheng $
//

#ifndef ZZHENG_LOGGING_CONSOLE_HPP_20080904__
#define ZZHENG_LOGGING_CONSOLE_HPP_20080904__

#include <zzheng/logging/config.hpp>
#include <zzheng/logging/destination.hpp>
#include <zzheng/logging/log_level.hpp>

#include <string>

namespace zzheng {
namespace logging {

    class console: public destination {

    public:

        explicit console(): destination(console_destination) {
            // Do nothing.
        }

        // TODO: copy?
        // Use auto-generated destructor.

        bool use_stderr() const {
            return get_prop<bool>("use_stderr", false);
        }

        console& set_use_stderr(bool use_stderr) {
            set_prop("use_stderr", use_stderr);
            return *this;
        }

        bool immediate_flush() const {
            return get_prop<bool>("immediate_flush", true);
        }

        console& set_immediate_flush(bool immediate_flush) {
            set_prop("immediate_flush", immediate_flush);
            return *this;
        }

    }; // class console

} // namespace zzheng::logging
} // namespace zzheng

#endif // ZZHENG_LOGGING_CONSOLE_HPP_20080904__

